repo.or.cz
/
andmenj-acm.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
10000 - Longest Paths (Grafos, BFS, Dijkstra)
[andmenj-acm.git]
/
10812 - Beat the spread
/
10812.cpp
blob
c2d71676abecb21ee306e17e069fc34be8a2aca6
1
#include <iostream>
2
3
using namespace
std
;
4
5
int
main
(){
6
int
n
;
7
cin
>>
n
;
8
while
(
n
--){
9
unsigned long long
s
,
d
,
x
,
y
;
10
cin
>>
s
>>
d
;
11
if
(
s
<
d
|| (
s
+
d
)%
2
!=
0
|| (
s
-
d
)%
2
!=
0
){
12
cout
<<
"impossible"
<<
endl
;
13
}
else
{
14
cout
<< (
s
+
d
)/
2
<<
" "
<< (
s
-
d
)/
2
<<
endl
;
15
}
16
}
17
return
0
;
18
}